package test2;

public class demo52 {
    class Solution {
        public boolean canJump(int[] nums) {
            int max = 0;
            int len = nums.length;
            for(int i = 0;i<=max&&i<len;i++)
            {
                max = Math.max(nums[i]+i,max);
            }
            if(max >= len-1) return true;
            return false;
        }
    }
}
